You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enable extensions to participate in infra generate - #10899
Extensions, like azure.resources need to be able to generate infra (via azd infra generate). For resources, especially, this is a key step for users - it's how they go from the simplified resources they've been using to the more advanced scenarios, where they want to dive into the bicep.
Currently infra gen only works against it's own internal sources, so this PR makes it so you can register an infra gen provider-equivalent, and get called when the user calls infra generate.
Azure Pipelines:
Successfully started running 2 pipeline(s).
25 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
An outdated constructor call prevents test compilation, and generation can silently overwrite edited manifests or overwrite another entry’s files through colliding output paths.
Enables extensions to participate in azd infra generate independently of provisioning, with azure.resources exporting resource declarations to editable Bicep sources.
Changes:
Adds a beta-only generation contract, SDK registration, and authenticated provider routing.
Integrates targeted extension activation and validated project configuration updates into infrastructure generation.
Implements resources-to-Bicep export with path and overwrite checks, tests, and documentation.
Extension user-contract review: blocked — 14 extension files inspected; 0 new contract comments; review history unavailable for existing-thread verification.
File
Description
docs/reference/feature-status.md
Lists infrastructure generation as beta-only.
docs/guides/creating-an-extension.md
Documents generator registration and responsibilities.
docs/architecture/extension-framework.md
Adds generation capability and service documentation.
cli/azd/pkg/project/infra_generation.go
Coordinates generation, validation, and configuration replacement.
cli/azd/pkg/project/infra_generation_test.go
Covers generation and configuration preservation.
cli/azd/pkg/project/importer.go
Adds a comment directing extension generation to the new manager.
cli/azd/pkg/extensions/validate_registry.go
Accepts the generation capability.
cli/azd/pkg/extensions/resolution.go
Maps generation capability to provider type.
cli/azd/pkg/extensions/resolution_test.go
Tests capability and provider-type matching.
cli/azd/pkg/extensions/registry.go
Defines generation capability and provider identifiers.
Avoid starting generation-only extensions for unrelated commands
cli/azd/cmd/middleware/extensions.go:34
Adding this capability starts every installed generation-only extension during unrelated commands that use ExtensionsMiddleware, adding a process launch and readiness wait even when no generation occurs. infra generate already activates matching generators through EnsureInfraGenerationProviders, so remove this entry from the general listener list. Update middleware_test.go:908–910 accordingly.
Clear broker and provider registrations when closing the host
Close retains the closed broker, so a later run of the same host reuses a dead stream instead of reconnecting. Reset the broker and clear provider registrations so the same names can be advertised again, matching the cleanup in cli/azd/pkg/azdext/provisioning_manager.go:80–90. Resetting only the broker leaves registration retries failing as duplicates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extensions, like
azure.resourcesneed to be able to generate infra (viaazd infra generate). For resources, especially, this is a key step for users - it's how they go from the simplified resources they've been using to the more advanced scenarios, where they want to dive into the bicep.Currently infra gen only works against it's own internal sources, so this PR makes it so you can register an infra gen provider-equivalent, and get called when the user calls
infra generate.